home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / nivb / wse.frm < prev   
Text File  |  1995-05-07  |  6KB  |  194 lines

  1. VERSION 2.00
  2. Begin Form WSEForm 
  3.    Caption         =   "Workstation Environment Services Test"
  4.    ClientHeight    =   3615
  5.    ClientLeft      =   1695
  6.    ClientTop       =   1545
  7.    ClientWidth     =   5370
  8.    Height          =   4020
  9.    Left            =   1635
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   3615
  12.    ScaleWidth      =   5370
  13.    Top             =   1200
  14.    Width           =   5490
  15.    Begin CommandButton DoneButton 
  16.       Caption         =   "&OK"
  17.       Height          =   372
  18.       Left            =   2280
  19.       TabIndex        =   0
  20.       Top             =   3120
  21.       Width           =   852
  22.    End
  23.    Begin Label ShortHwTypeLabel 
  24.       Height          =   252
  25.       Left            =   2520
  26.       TabIndex        =   15
  27.       Top             =   2400
  28.       Width           =   1812
  29.    End
  30.    Begin Label HwTypeLabel 
  31.       Height          =   252
  32.       Left            =   2520
  33.       TabIndex        =   14
  34.       Top             =   2160
  35.       Width           =   1812
  36.    End
  37.    Begin Label osVerLabel 
  38.       Height          =   252
  39.       Left            =   2520
  40.       TabIndex        =   13
  41.       Top             =   1920
  42.       Width           =   1812
  43.    End
  44.    Begin Label LocalDriveLabel 
  45.       Height          =   252
  46.       Left            =   2520
  47.       TabIndex        =   12
  48.       Top             =   2760
  49.       Width           =   972
  50.    End
  51.    Begin Label OSTypeLabel 
  52.       Height          =   252
  53.       Left            =   2520
  54.       TabIndex        =   11
  55.       Top             =   1680
  56.       Width           =   1812
  57.    End
  58.    Begin Label ShellVerLabel 
  59.       Height          =   252
  60.       Left            =   2520
  61.       TabIndex        =   10
  62.       Top             =   1200
  63.       Width           =   972
  64.    End
  65.    Begin Label PrimaryLabel 
  66.       Height          =   252
  67.       Left            =   2520
  68.       TabIndex        =   9
  69.       Top             =   720
  70.       Width           =   2532
  71.    End
  72.    Begin Label PreferredLabel 
  73.       Height          =   252
  74.       Left            =   2520
  75.       TabIndex        =   8
  76.       Top             =   480
  77.       Width           =   2532
  78.    End
  79.    Begin Label DefaultLabel 
  80.       Height          =   252
  81.       Left            =   2520
  82.       TabIndex        =   7
  83.       Top             =   240
  84.       Width           =   2532
  85.    End
  86.    Begin Label Label6 
  87.       Alignment       =   1  'Right Justify
  88.       Caption         =   "Workstation Environment description strings:"
  89.       Height          =   372
  90.       Left            =   240
  91.       TabIndex        =   6
  92.       Top             =   1560
  93.       Width           =   2172
  94.    End
  95.    Begin Label Label5 
  96.       Alignment       =   1  'Right Justify
  97.       Caption         =   "NetWare Shell version:"
  98.       Height          =   255
  99.       Left            =   240
  100.       TabIndex        =   5
  101.       Top             =   1200
  102.       Width           =   2175
  103.    End
  104.    Begin Label Label4 
  105.       Alignment       =   1  'Right Justify
  106.       Caption         =   "Number of Local Drives:"
  107.       Height          =   255
  108.       Left            =   240
  109.       TabIndex        =   4
  110.       Top             =   2760
  111.       Width           =   2175
  112.    End
  113.    Begin Label Label3 
  114.       Alignment       =   1  'Right Justify
  115.       Caption         =   "Primary connection ID:"
  116.       Height          =   255
  117.       Left            =   360
  118.       TabIndex        =   3
  119.       Top             =   720
  120.       Width           =   2055
  121.    End
  122.    Begin Label Label2 
  123.       Alignment       =   1  'Right Justify
  124.       Caption         =   "Preferred connection ID:"
  125.       Height          =   255
  126.       Left            =   240
  127.       TabIndex        =   2
  128.       Top             =   480
  129.       Width           =   2175
  130.    End
  131.    Begin Label Label1 
  132.       Alignment       =   1  'Right Justify
  133.       Caption         =   "Default connection ID:"
  134.       Height          =   255
  135.       Left            =   240
  136.       TabIndex        =   1
  137.       Top             =   240
  138.       Width           =   2175
  139.    End
  140. End
  141.  
  142. Sub DoneButton_Click ()
  143.     Unload WSEForm
  144. End Sub
  145.  
  146. Sub Form_Load ()
  147.     Dim osType As String * 10
  148.     Dim osVer As String * 10
  149.     Dim hwType As String * 10
  150.     Dim shortHwType As String * 10
  151.  
  152.     fileServerName$ = String$(48, 0)
  153.     fileServerName$ = GetDefaultFileServerName()
  154.     fileServerName$ = Left$(fileServerName$, InStr(fileServerName$, Chr$(0)) - 1)
  155.     DefaultLabel.Caption = Format$(defaultConnID%) + "    (" + fileServerName$ + ")"
  156.     
  157.     fileServerName$ = String$(48, 0)
  158.     preferredConnID% = GetPreferredConnectionID()
  159.     If (preferredConnID% <> 0) Then
  160.         GetFileServerName preferredConnID%, fileServerName$
  161.         fileServerName$ = Left$(fileServerName$, InStr(fileServerName$, Chr$(0)) - 1)
  162.         PreferredLabel.Caption = Format$(preferredConnID%) + "    (" + fileServerName$ + ")"
  163.     Else
  164.         PreferredLabel.Caption = "Not set"
  165.     End If
  166.     
  167.     fileServerName$ = String$(48, 0)
  168.     primaryConnID% = GetPrimaryConnectionID()
  169.     If (primaryConnID% <> 0) Then
  170.         GetFileServerName primaryConnID%, fileServerName$
  171.         fileServerName$ = Left$(fileServerName$, InStr(fileServerName$, Chr$(0)) - 1)
  172.         PrimaryLabel.Caption = Format$(primaryConnID%) + "    (" + fileServerName$ + ")"
  173.     Else
  174.         PrimaryLabel.Caption = "Not set"
  175.     End If
  176.     
  177.     ccode% = GetNetWareShellVersion(majorVersion%, minorVersion%, revLevel%)
  178.     If (ccode% = 255) Then
  179.         ShellVerLabel.Caption = Format$(majorVersion%) + "." + Format$(minorVersion%) + Chr$(revLevel% + 97)
  180.     Else
  181.         ShellVerLabel.Caption = "Ancient"
  182.     End If
  183.  
  184.     numDrives% = GetNumberOfLocalDrives()
  185.     LocalDriveLabel.Caption = Format$(numDrives%)
  186.  
  187.     GetWorkstationEnvironment ByVal osType, ByVal osVer, ByVal hwType, ByVal shortHwType
  188.     OsTypeLabel.Caption = osType
  189.     OsVerLabel.Caption = osVer
  190.     HwTypeLabel.Caption = hwType
  191.     ShortHwTypeLabel = shortHwType
  192. End Sub
  193.  
  194.